package com.coolingme.calculatebracket.expression.nonterminal;

import com.coolingme.calculatebracket.IArithmeticInterpreter;
import com.coolingme.calculatebracket.expression.TerminalInterpreter;

/**
 * @author wangyue
 * @date 2022/12/25 17:02
 */
public class SubInterpreter extends TerminalInterpreter {
    public SubInterpreter(IArithmeticInterpreter left, IArithmeticInterpreter right) {
        super(left, right);
    }

    @Override
    public int interpret() {
        return this.left.interpret() - this.right.interpret();
    }
}

